package educationaladministrationsystem.CSM.Mapper;

import educationaladministrationsystem.Class.Count;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface LoginMapper {
    @Select("select count(*) from Count where countNumber=#{countNumber} and password=#{password} and identification=#{identification}")
    Integer getCount(Count count);

    @Insert("insert into Count values (#{countNumber},#{password},#{identification},#{id})")
    Integer insertCount(Count count);

    @Update("update count set password=#{newPassword} where countNumber=#{countNumber}")
    void PasswordUpdate(String newPassword, String countNumber);

    @Select("select id from count where countNumber=#{countNumber}")
    String getUID(String countNumber);
}
